<template>
    <div>
        <van-field label="手机号:" v-model="form.mobile" placeholder="请输入手机号"></van-field>
        <van-field label="验证码:" v-model="form.code" placeholder="请输入验证码"></van-field><van-button @click="send">发送验证码</van-button>
        <van-button @click="add">登录</van-button>
    </div>
</template>

<script>
    export default {
        data(){
            return{
                form:{}
            }
        },
        methods:{
            add(){
                this.$axios.post("text/tlogin",this.form).then(res=>{
                    alert(res.data.mes)
                })
            },
            send(){
                this.$axios.post("text/sendSms",{'mobile':this.form.mobile}).then(res=>{
                    alert(res.data.mes)
                })
            }
        },
        mounted(){}
    }
</script>

<style scoped>

</style>